import request from '@/common/js/request.js'

export default {
	
	// 条件分页查询文章列表数据
	getList(query, currentPage, pageSize) {
		return request({
			url: '/api/article/list',
			method: 'GET',
			data: {
				...query,
				currentPage,
				pageSize
			} // {isFree: 0, current: current, size: size}
		})
	},
	
	//通过文章id查询文章详情页
	getArticleById(articleById){
		return request({
			url: `/api/article/getReadList/${articleById}`,
			method: 'GET',
		})
	},
	
	//通过文章id查询评论列表
	getArticleCommentById(articleById){
		return request({
			url: `/api/articleComment/getComment/${articleById}`,
			method: 'GET',
		})
	},
	
	addComment(data){
		return request({
			url: `/api/articleComment`,
			method: 'POST',
			data
		})
	}
	
}